package com.benben.springSecurity.weiwei;

import java.util.Arrays;

public class MinSortCount {
    public static void main(String[] args) {
        int[] input = {1,1,4,2,1,3};
        System.out.println(minSortNumbers(input));
    }
    public static int minSortNumbers(int[] array){
        int length = array.length;
        int[] tempArr = new int[length];
        tempArr = array.clone();
        Arrays.sort(tempArr);
        int count = 0;
        for(int i=0;i<length;i++){
            if(array[i] != tempArr[i]){
                count++;
            }
        }
        return count;
    }
}
